package com.dtguai.app.model;

import com.dtguai.app.page.PageModel;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.ibatis.type.Alias;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;

/**
 * 用户表
 *
 * @author guoLiang
 * @date 2021年2月23日17:40:37
 */
@Alias("user")
@Table(name = "user")
@Data
@EqualsAndHashCode(callSuper = true)
@Builder
@Entity
@AllArgsConstructor
public class User extends PageModel implements Serializable {

    private static final long serialVersionUID = 1L;

    public User() {
        super();
    }

    public User(Integer id) {
        super();
        super.setId(id);
    }

    /**
     * 手机号
     */
    @ApiModelProperty(value = "手机号")
    @Column(name = "mobile")
    private String mobile;
    /**
     * 用户名
     */
    @ApiModelProperty(value = "用户名")
    @Column(name = "name")
    private String name;
    /**
     * 密码
     */
    @ApiModelProperty(value = "密码")
    @Column(name = "password")
    @JsonIgnore
    private String password;
    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @Column(name = "create_time")
    private Date createTime;
    /**
     * 状态
     */
    @ApiModelProperty(value = "状态")
    @Column(name = "type")
    private Integer type;
    /**
     * token
     */
    @ApiModelProperty(value = "token")
    @Column(name = "token")
    private String token;
    /**
     * 过期时间
     */
    @ApiModelProperty(value = "过期时间")
    @Transient
    private Long expire;
    /**
     * imei号
     */
    @ApiModelProperty(value = "imei号")
    @Column(name = "imei")
    private String imei;

}